/*    */ package com.zimbra.cs.account.soap;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.soap.admin.message.GetAccountInfoResponse;
/*    */ import com.zimbra.soap.admin.type.Attr;
/*    */ import java.util.ArrayList;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SoapAccountInfo
/*    */ {
/*    */   private Map<String, Object> mAttrs;
/*    */   private String mName;
/*    */   private List<String> mSoapURL;
/*    */   private String mAdminSoapURL;
/*    */   
/*    */   SoapAccountInfo(GetAccountInfoResponse resp)
/*    */     throws ServiceException
/*    */   {
/* 40 */     this.mAttrs = Attr.collectionToMap(resp.getAttrList());
/* 41 */     this.mName = resp.getName();
/* 42 */     this.mSoapURL = resp.getSoapURLList();
/* 43 */     this.mAdminSoapURL = resp.getAdminSoapURL();
/*    */   }
/*    */   
/*    */   SoapAccountInfo(Element e) throws ServiceException {
/* 47 */     this.mAttrs = SoapProvisioning.getAttrs(e);
/* 48 */     this.mName = e.getElement("name").getText();
/* 49 */     this.mSoapURL = new ArrayList();
/* 50 */     for (Element su : e.listElements("soapURL")) {
/* 51 */       this.mSoapURL.add(su.getText());
/*    */     }
/* 53 */     this.mAdminSoapURL = e.getElement("adminSoapURL").getText();
/*    */   }
/*    */   
/* 56 */   public List<String> getSoapURL() { return this.mSoapURL; }
/* 57 */   public String getAdminSoapURL() { return this.mAdminSoapURL; }
/*    */   
/*    */   public String getAttr(String name) {
/* 60 */     Object v = this.mAttrs.get(name);
/* 61 */     if ((v instanceof String))
/* 62 */       return (String)v;
/* 63 */     if ((v instanceof String[])) {
/* 64 */       String[] a = (String[])v;
/* 65 */       return a.length > 0 ? a[0] : null;
/*    */     }
/* 67 */     return null;
/*    */   }
/*    */   
/*    */   public String getAttr(String name, String defaultValue)
/*    */   {
/* 72 */     String v = getAttr(name);
/* 73 */     return v == null ? defaultValue : v;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/account/soap/SoapAccountInfo.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */